package com.xiaoshuidi.cloud.module.contract.controller.admin.contract;

import com.xiaoshuidi.cloud.framework.common.pojo.CommonResult;
import com.xiaoshuidi.cloud.module.contract.controller.admin.contract.vo.TabletContractRespVO;
import com.xiaoshuidi.cloud.module.contract.enums.ApiConstants;
import com.xiaoshuidi.cloud.module.contract.service.contract.ElectronicContractService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static com.xiaoshuidi.cloud.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - 写字板合同")
@RestController
@RequestMapping(ApiConstants.NAME + "/tablet-contract")
@Validated
public class TabletContractController {

    @Resource
    private ElectronicContractService electronicContractService;

    @GetMapping("/tablet-sign")
    @Operation(summary = "手写板签约")
    @Parameter(name = "contractId", description = "合同id", required = true, example = "1024")
    public CommonResult<TabletContractRespVO> tabletContractSign(@RequestParam("contractId") Long contractId) {
        return success(electronicContractService.tabletContractSign(contractId));
    }

}
